<?php

class GlobalPermision
{
	
	   
	public static function getPermModules()
	{
		$config = Globals::getConfiguration();
		if(!isset($config->permission_modules))
		{
			 return array();
		}
		
		$list = $config->permission_modules->list;
		$arr = explode(',', $list);
		return $arr;
	}
	
	public static function getPermList($modulename)
	{
		
		$config = Globals::getConfiguration();
		
		if(!isset($config->permission_modules->$modulename))
		{
			return null;
		}
		else
		{
			return $config->permission_modules->$modulename->toArray();
		}
	}
}